package marlon.smsbatcheditor.activity;

import java.util.List;

import marlon.smsbatcheditor.model.Rule;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

/**
 * @author marlonyao<yaolei135@gmail.com>
 *
 */
class RulesAdapter extends ArrayAdapter<Rule> {
	public RulesAdapter(Context context, List<Rule> rules) {
		super(context, android.R.layout.simple_list_item_1, rules);
	}

	public RulesAdapter(Context context, int resource, List<Rule> rules) {
		super(context, resource, rules);
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		TextView tv = (TextView) super.getView(position, convertView, parent);
		tv.setText(getItem(position).getName());
		return tv;
	}
}